# -*- coding: utf-8 -*-
# @Author   : niejiali
# @Time     : 2019/1/23 13:59
# @File     : __add.py
# @Software : PyCharm


class Scope:
    allow_api = []
    allow_moudle = []

    def __add__(self, other):
        self.allow_api = self.allow_api + other.allow_api
        self.allow_api = list(set(self.allow_api))
        return self


class AdminScope(Scope):
    allow_api = ['v1.super_get_user']

    def __init__(self):
        self+UserScope()
        print(self.allow_api)


class UserScope(Scope):
    allow_api = ['v1.A', 'v1.B']


class SuperScope(Scope):
    allow_api = ['v1.C', 'v1.D']

    def __init__(self):
        self + UserScope()+AdminScope()
        print(self.allow_api)


SuperScope()
AdminScope()
